package digitaldreamers.libraries.games.clients.networkmanagement.abstracts;

import digitaldreamers.libraries.games.clients.networkmanagement.packets.sending.AbSendablePacket;
import java.io.IOException;
import java.net.UnknownHostException;

/**
 *
 * @author DaoLe
 */
public interface IConnectionHandler {
    
    public static interface OnDataReceivedListener {
        void onDataReceived(byte[] arr_byData) throws IOException;
    }
    
    void addEventListener(OnDataReceivedListener listener);

    void removeEventListener(OnDataReceivedListener listener);

    void fireDataReceivedEvent(byte[] arr_byData) throws IOException;
    
    void connectToServer(String strIP, int iPort) throws UnknownHostException, IOException;
    
    void send(AbSendablePacket sendablePacket) throws IOException;
}
